﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace Miao.UI
{

    public class WorldUI : PoolObject
    {
        public GameObject bindWorldObj { get; set; }

         public virtual void Start()
        {
            MiaoRuntime.Updater.AddUpdate(Updater);
        }

        
        protected override void OnDestroy()
        {
            base.OnDestroy();
            MiaoRuntime.Updater.RemoveUpdate(Updater);
        }

        virtual public void Init(GameObject bindWorldObj)
        {
            this.bindWorldObj = bindWorldObj;
        }

        virtual public void Updater()
        {
            this.transform.position = bindWorldObj.transform.position;
        }

    }

}